package com.sparsearr.datastructures.itheima.jiemi;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 * @Author: ZhaoTR
 * @Date: Created in 2025/4/19 17:26
 * @Description: 数字解密
 * @Version: 1.0
 */

public class JM {
    private static final Logger logger = LogManager.getLogger(JM.class);

    public static void main(String[] args) {
        int[] arr = {8, 3, 4, 6};
        for (int i = 0, j = arr.length - 1; i < j; i++, j--) {
            int temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }

        for (int i = 0; i < arr.length; i++) {
            if (arr[i] >= 0 && arr[i] <= 4) {
                arr[i] += 10;
            }
        }

        for (int i = 0; i < arr.length; i++) {
            arr[i] -= 5;
        }
        int number = 0;

        for (int i = 0; i < arr.length; i++) {
            number = number * 10 + arr[i];
        }

        logger.info("解密后的数字为：{}", number);
    }
}
